package com.example.demo.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name="sys_user")
public class SysUser implements Serializable {

	/**ID*/
	@Id
	public String id;
	
	/**名字*/
	@Column(name="user_name")
	public String name ;
	
	/**邮箱*/
	@Column(name="e_mail")
	public String eMail;
	
	/**年龄*/
	@Column(name="age")
	public Integer age;
	
	/**密码*/
	@Column(name="password")
	public String passWord;

	/**部门*/
	@ManyToOne(cascade=CascadeType.ALL,optional=true,targetEntity=SysDept.class)
	@JoinColumn(name = "dept_id")
	public SysDept dept_id;
	
	@ManyToOne(cascade=CascadeType.ALL,optional=true,targetEntity=SysUser.class)
	@JoinColumn(name="parentUser")
	public SysUser parentUser;
	
	/**角色*/
	//public SysRole role_id;
	/**
	 * GET/SET集合
	 * @return
	 */
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String geteMail() {
		return eMail;
	}

	public void seteMail(String eMail) {
		this.eMail = eMail;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getPassWord() {
		return passWord;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	public SysDept getDept_id() {
		return dept_id;
	}

	public void setDept_id(SysDept dept_id) {
		this.dept_id = dept_id;
	}

	public SysUser getParentUser() {
		return parentUser;
	}

	public void setParentUser(SysUser parentUser) {
		this.parentUser = parentUser;
	}

	@Override
	public String toString() {
		return "SysUser [id=" + id + ", name=" + name + ", eMail=" + eMail + ", age=" + age + ", passWord=" + passWord
				+ ", dept_id=" + dept_id + ", parentUser=" + parentUser + "]";
	}

	
}
